package com.bgds.sys.data.iXCom29d.gateway.impl;

import com.cisdi.data.sdk.gateway.netty.IoSession;
import com.cisdi.data.sdk.gateway.netty.impl.AbstractSessionFactory;

import java.nio.charset.Charset;
import java.util.UUID;

/**
 * @author
 */
public class BaoXingSessionFactory extends AbstractSessionFactory {
	
	private String deviceId;
	private Charset charset;
	
	public BaoXingSessionFactory(String deviceId, Charset charset) {
		super();
		this.deviceId = deviceId;
		this.charset = charset;
	}

	@Override
	public IoSession newSession() {
		IoSession session = new BaoXingSession(deviceId, charset);
		session.init(UUID.randomUUID().toString(), provider, socketGateway);
		sessionSet.add(session);
		return session;
	}
}
